package com.example.mushroom.service.impl;

import com.example.mushroom.entity.AlertRule;
import com.example.mushroom.mapper.AlertRuleMapper;
import com.example.mushroom.service.AlertRuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AlertRuleServiceImpl implements AlertRuleService {

    @Autowired
    private AlertRuleMapper alertRuleMapper;

    @Override
    public int insertAlertRule(AlertRule alertRule) {
        return alertRuleMapper.insertAlertRule(alertRule);
    }

    @Override
    public AlertRule selectAlertRuleById(Integer id) {
        return alertRuleMapper.selectAlertRuleById(id);
    }

    @Override
    public List<AlertRule> selectAllAlertRules() {
        return alertRuleMapper.selectAllAlertRules();
    }

    @Override
    public int updateAlertRule(AlertRule alertRule) {
        return alertRuleMapper.updateAlertRule(alertRule);
    }

    @Override
    public int deleteAlertRuleById(Integer id) {
        return alertRuleMapper.deleteAlertRuleById(id);
    }

    @Override
    public List<AlertRule> selectAlertRulesByPage(int offset, int limit) {
        return alertRuleMapper.selectAlertRulesByPage(offset, limit);
    }
}